﻿<cfsilent>
	<cfscript>
		
		dictAdvice = getProperty("serviceFactory").getBean("senateDictionaryAdvice");
		sessionAdvice = getProperty("serviceFactory").getBean("sessionAdvice");
		
		depId = sessionAdvice.getUserProp("teacherDepartment");

		sql = "SELECT 
					institute_id, institute_name 
				FROM 
					t_institute 
				WHERE 
					institute_id = :instituteId ";
					
		queryObj = new query( datasource=application.dnsSlave );
		queryObj.addParam( name="instituteId", value=depId, cfsqltype="cf_sql_varchar" );
		
		rs_department = queryObj.execute( sql=sql ).getResult();
				
		sql = "SELECT 
					a.course_name, a.cid, a.course_code, a.course_credit, 
					a.institute_id, a.cat_id, a.mark_mode, a.abandon, 
					t_institute.institute_name, t_course_catalog.cat_name, 
					a.resit_policy, a.period_theory, a.period_practice, 
					a.period_computer, a.period_week, a.course_english, 
					a.intro, a.reference_books 
				FROM 
					t_course a 
					INNER JOIN t_institute ON t_institute.institute_id = a.institute_id 
					INNER JOIN t_course_catalog ON t_course_catalog.cat_id = a.cat_id 
				WHERE 
					a.cid = :cid ";
					
		queryObj = new query( datasource=application.dnsSlave );
		queryObj.addParam( name="cid", value=event.getArg("CID"), cfsqltype="cf_sql_varchar" );
		
		rs_course = queryObj.execute( sql=sql ).getResult();
		
		event.setArg("pageTitle", "教学运行基础数据 - 课程库维护 -" & rs_course.course_name);
		
		targetArgs = structNew();
		structInsert(targetArgs, "DepID", rs_department.institute_id, true);
		
		currentTab = event.getArg("TabID", "labCourse");
		
	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('programCourse', targetArgs)#</cfoutput>"><i class="mrs img btnPublish"></i><span class="uiButtonText"><cfoutput>#rs_department.institute_name#</cfoutput>课程</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 course"></i><cfoutput>#rs_course.course_name#</cfoutput>
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="summary">
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labCourse">class="active"</cfif> id="labCourse" tabTarget="Course">修订课程信息</span>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					// -->
					//]]>
				</script>
				
				<div id="Course" class="tabContent">
					
					<form id="formEdit" onSubmit="javascript:return processVerfiyForm('formEdit');" class="formWrapper" method="post" action="<cfoutput>#buildURL('courseUpdateDo')#</cfoutput>">
						
						<input type="hidden" name="CourseID" value="<cfoutput>#rs_course.cid#</cfoutput>" />
						<input type="hidden" name="CourseCode" value="<cfoutput>#rs_course.course_code#</cfoutput>" />

						<input type="hidden" name="CourseName" value="<cfoutput>#rs_course.course_name#</cfoutput>" />
						<input type="hidden" name="Credit" value="<cfoutput>#rs_course.course_credit#</cfoutput>" />
						<input type="hidden" name="InstituteID" value="<cfoutput>#rs_course.institute_id#</cfoutput>" />
						<input type="hidden" name="CatID" value="<cfoutput>#rs_course.cat_id#</cfoutput>" />
						<input type="hidden" name="MarkMode" value="<cfoutput>#rs_course.mark_mode#</cfoutput>" />
						<input type="hidden" name="Abandon" value="<cfoutput>#rs_course.abandon#</cfoutput>" />
						
						<div class="label">
							<b>课程</b>
							<p><cfoutput>#rs_course.course_name#</cfoutput></p>
						</div>
						
						<div class="label">
							<b>课程号</b>
							<p><cfoutput>#rs_course.course_code#</cfoutput></p>
						</div>
						
						<div class="label">
							<b>学分</b>
							<p><cfoutput>#numberFormat(rs_course.course_credit, "0.00")#</cfoutput></p>
						</div>

						<div class="label">
							<b>任课单位</b>
							<p><cfoutput>#rs_course.institute_name#</cfoutput> (<cfoutput>#rs_course.cat_name#</cfoutput>)</p>
						</div>

						<div class="label">
							<b>计分模式</b>
							<p><cfoutput>#dictAdvice.getMarkModeName(rs_course.mark_mode)#</cfoutput></p>
						</div>
						
						<div class="label">
							<b>是否安排补考</b>
							<input name="ResitPolicy" type="radio" class="typeRadio" value="1" <cfif event.getArg('ResitPolicy', rs_course.resit_policy) eq '1'>checked="checked"</cfif> />是
							<input name="ResitPolicy" type="radio" class="typeRadio" value="0" <cfif event.getArg('ResitPolicy', rs_course.resit_policy) eq '0'>checked="checked"</cfif>/>否
						</div>
						
						<hr/>
						
						<div class="label">
							<span class="req">*</span><b>学时分布</b>
							理论学时<input name="PeriodTheory" id="PeriodTheory" type="text" class="typeTinyInt" verification="integer" maxlength="4" value="<cfoutput>#event.getArg('PeriodTheory', rs_course.period_theory)#</cfoutput>" />
							实践学时<input name="PeriodPractice" id="PeriodPractice" type="text" class="typeTinyInt" verification="integer" maxlength="4" value="<cfoutput>#event.getArg('PeriodPractice', rs_course.period_practice)#</cfoutput>" />
							上机学时<input name="PeriodComputer" id="PeriodComputer" type="text" class="typeTinyInt" verification="integer" maxlength="4" value="<cfoutput>#event.getArg('PeriodComputer', rs_course.period_computer)#</cfoutput>" />
						</div>
						
						<div class="label">
							<b>排课周学时</b>
							<select name="PeriodPerWeek">
								<option <cfif event.getArg('PeriodPerWeek', rs_course.period_week) eq 0>selected="selected"</cfif> value="0">不排课</option>
								<option <cfif event.getArg('PeriodPerWeek', rs_course.period_week) eq 2>selected="selected"</cfif> value="2">每周一次课, 安排2小节</option>
								<option <cfif event.getArg('PeriodPerWeek', rs_course.period_week) eq 3>selected="selected"</cfif> value="3">每周一次课, 安排3小节</option>
								<option <cfif event.getArg('PeriodPerWeek', rs_course.period_week) eq 4>selected="selected"</cfif> value="4">每周两次课, 每次2小节 或 每周一次课, 连续4小节</option>
								<option <cfif event.getArg('PeriodPerWeek', rs_course.period_week) eq 5>selected="selected"</cfif> value="5">每周两次课, 一次2小节,一次3小节 或 每周一次课, 连续5小节</option>
								<option <cfif event.getArg('PeriodPerWeek', rs_course.period_week) eq 6>selected="selected"</cfif> value="6">每周三次课, 每次2小节 或 每周两次课, 每次3小节 或 一次4小节, 一次3小节</option>
								<option <cfif event.getArg('PeriodPerWeek', rs_course.period_week) eq 8>selected="selected"</cfif> value="8">每周四次课, 每次2小节 或 每周三次课, 两次3小节, 一次2小节 或 每周两次课,每次4小节</option>
								<option <cfif event.getArg('PeriodPerWeek', rs_course.period_week) eq 10>selected="selected"</cfif> value="10">每周五次课, 每次2小节 或 每周四次课, 两次3小节, 两次2小节</option>
								<option <cfif event.getArg('PeriodPerWeek', rs_course.period_week) eq 16>selected="selected"</cfif> value="16">每周四次课，每次4小节</option>
							</select>
						</div>

						<hr/>
						
						<div class="label">
							<b>英文名称</b>
							<input name="CourseEnglish" id="CourseEnglish" type="text" class="typeText typeEnglish" maxlength="180" value="<cfoutput>#event.getArg('CourseEnglish', rs_course.course_english)#</cfoutput>" />
						</div>
						
						<div class="label">
							<b>课程介绍</b>
							<textarea name="Intro" id="Intro"><cfoutput>#event.getArg('Intro', rs_course.intro)#</cfoutput></textarea>
						</div>
						
						<div class="label">
							<b>参考书</b>
							<textarea name="ReferenceBooks" id="ReferenceBooks"><cfoutput>#event.getArg('ReferenceBooks', rs_course.reference_books)#</cfoutput></textarea>
						</div>
						
						<hr/>
						
						<div class="lable">
							<input class="button" type="submit" value="更新" />
							<input class="button" type="reset" value="重设表格" />
						</div>
						
					</form>
					
				</div>
				
				<div id="Remove" class="tabContent">
					
					<div class="systemNotice">
						<h3><span class="img icon16x16 info"></span>删除课程信息</h3>
						<p>注意: 删除一个课程信息的同时, 会同时删除与课程相关所有教学数据信息. </p>
						<p>如果您确定<cfoutput>#rs_course.course_name#</cfoutput>在当前的教学安排中未使用, 并且在以后都不再使用改课程, 您可以在这里进行信息删除. 如果这些课程还安排有相关教学任务, 由于数据完整性维护的强制性要求, 这些相关信息会被同样删除. </p>
					
						<form id="formRemove" class="formWrapper Transparent" method="post" action="<cfoutput>#buildURL('courseRemoveDo')#</cfoutput>">
							<input type="hidden" name="InstituteID" value="<cfoutput>#rs_course.institute_id#</cfoutput>" />
							<input type="hidden" name="CourseID" value="<cfoutput>#rs_course.cid#</cfoutput>" />
							<div class="lable"><input class="button2" type="submit" value="删除课程" /></div>
						</form>
					</div>
					
				</div>
				
			</div>
		</li>
	</ul>
</div>


